<template>
  <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" background-color="#545c64"
    text-color="#fff" active-text-color="#ffd04b" @select="handleSelect">
    <el-menu-item index="1">Processing Center</el-menu-item>
    <el-sub-menu index="2">
      <template #title>Workspace</template>
      <el-menu-item index="2-1">item one</el-menu-item>
      <el-menu-item index="2-2">item two</el-menu-item>
      <el-menu-item index="2-3">item three</el-menu-item>
      <el-sub-menu index="2-4">
        <template #title>item four</template>
        <el-menu-item index="2-4-1">item one</el-menu-item>
        <el-menu-item index="2-4-2">item two</el-menu-item>
        <el-menu-item index="2-4-3">item three</el-menu-item>
      </el-sub-menu>
    </el-sub-menu>
    <el-menu-item index="3">注册/登录</el-menu-item>
    <el-menu-item index="4">个人信息</el-menu-item>
  </el-menu>
  <!-- <MyForm></MyForm> -->
  <!-- <NewForm></NewForm> -->
  <!-- <Login></Login> -->
  <router-view></router-view>

</template>
<script setup>
import MyForm from './components/form/MyForm.vue'
import NewForm from './components/form/NewForm.vue';
import Login from './components/security/login.vue';
import { ref, reactive, getCurrentInstance } from 'vue';

const activeIndex = ref('1')
const activeIndex2 = ref('1')


const { proxy } = getCurrentInstance()
const handleSelect = (key, keyPath) => {
  if (key == 3) {
    proxy.$router.push('/login')
    console.log('yes')
  } else if (key == 4) {
    proxy.$router.push('/newform')
    console.log('yes')

  } else {
    console.log('but')
  }
}

</script>

<style scoped>

</style>
